package com.woniuxy.community_life.mapper;

import com.woniuxy.community_life.pojo.Comment;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CommentMapper {
    int deleteByPrimaryKey(Integer comId);

    int insert(Comment record);

    int insertSelective(Comment record);

    Comment selectByPrimaryKey(Integer comId);

    int updateByPrimaryKeySelective(Comment record);

    int updateByPrimaryKey(Comment record);

    @Select("select *from t_comment where d_id=#{dId} and flag=0 and type_id=1 order by comment_time")
    List<Comment> selectAllMessageBydId(Integer dId);

    @Delete("delete from t_comment where com_id=#{comId} and reply_a_id=#{aId}")
    void deleteComment(Integer comId, Integer aId);
}